(function(i){"use strict";i.HSCore.components.HSGoTo={_baseConfig:{},pageCollection:i(),init:function(t,o){this.collection=t&&i(t).length?i(t):i();if(!i(t).length)return;this.config=o&&i.isPlainObject(o)?i.extend({},this._baseConfig,o):this._baseConfig;this.config.itemSelector=t;this.initGoTo();return this.pageCollection},initGoTo:function(){var t=this,o=t.pageCollection;this.collection.each(function(t,s){var a=i(s),e=a.data("target"),n=a.data("type"),f=a.data("show-effect"),c=a.data("hide-effect"),l=JSON.parse(s.getAttribute("data-position")),d=i(a.data("compensation")).outerHeight(),r=a.data("offset-top");a.addClass("animated").css({display:"inline-block",position:n,opacity:0});if(n=="fixed"||n=="absolute"){a.css(l)}a.on("click",function(t){t.preventDefault();i("html, body").stop().animate({scrollTop:e?i(e).offset().top-d:0},800)});if(!a.data("offset-top")&&!a.hasClass("js-animation-was-fired")){if(a.offset().top<=i(window).height()){a.show();setTimeout(function(){a.addClass("js-animation-was-fired "+f).css({opacity:""})})}}i(window).on("scroll",function(){if(a.data("offset-top")){if(i(window).scrollTop()>=r&&!a.hasClass("js-animation-was-fired")){a.show();setTimeout(function(){a.addClass("js-animation-was-fired "+f).css({opacity:""})})}else if(i(window).scrollTop()<=r&&a.hasClass("js-animation-was-fired")){a.removeClass("js-animation-was-fired "+f);setTimeout(function(){a.addClass(c).css({opacity:0})},100);setTimeout(function(){a.removeClass(c).hide()},400)}}else{var t=a.offset().top;if(!a.hasClass("js-animation-was-fired")){if(i(window).scrollTop()>=t-i(window).height()){a.show();setTimeout(function(){a.addClass("js-animation-was-fired "+f).css({opacity:""})})}}}});i(window).trigger("scroll");o=o.add(a)})}}})(jQuery);
//# sourceMappingURL=hs.go-to.map.js